package com.itheima.jobs;

import com.itheima.mapper.OrderSettingMapper;
import com.itheima.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;


@Component
public class clearOrderSettingJob {

    @Autowired
    private OrderSettingMapper orderSettingMapper;

    public void clearOrderSetting(){

//        定时清除 数据库
        Date date = DateUtils.getFirstDay4ThisMonth();
        orderSettingMapper.deleteOrderSettingBeforeDate(date);
    }

}
